/*
 * @Author: shenya
 * @Date: 2023-11-01 10:34:30
 * @Description: 页面options
 */
export const tableOption = () => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    menuWidth: 100,
    menuHeaderAlign: 'left',
    column: [
      {
        label: '页面名称',
        prop: 'pageName',
        search: true,
        overHidden: true,
        maxlength: 20,
      },
      {
        label: 'APP路由',
        prop: 'appRouter',
        width: 200,
        overHidden: true,
      },
      {
        label: '小程序路由',
        prop: 'mpRouter',
        width: 200,
        overHidden: true,
      },
      {
        label: '页面截图',
        prop: 'pageAddress',
        slot: true,
      },
      {
        label: '创建时间',
        prop: 'createTime',
        overHidden: true,
        width: 160,
      },
    ],
  };
};
export const accountOption = () => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    addBtnText: '新增行',
    cellBtn: false,
    addRowBtn: true,
    saveBtn: false,
    columnBtn: false,
    menuWidth: 120,
    delBtn: false,
    editBtn: false,
    rowKey: 'ids',
    column: [
      {
        label: '参数',
        prop: 'parameter',
        cell: true,
        maxlength: 50,
        showWordLimit: true,
      },
      {
        label: '参数名称',
        prop: 'parameterName',
        cell: true,
        maxlength: 10,
        showWordLimit: true,
      },
    ],
  };
};
export const uploadOption = () => {
  return {
    labelWidth: 140,
    submitBtn: false,
    emptyBtn: false,
    column: [
      {
        label: '页面截图实例',
        prop: 'pageAddress',
        span: 24,
        type: 'upload',
        listType: 'picture-img',
        fileSize: 10 * 1024,
        fileType: 'img',
        accept: '.jpg,.png',
        propsHttp: {
          name: 'hash',
          url: 'key',
        },
        oss: 'qiniu',
        limit: 1,
        // cropperOption: {
        //   fixed: true,
        //   enlarge: 2,
        //   fixedNumber: [1, 0.544],
        // },
      },
    ],
  };
};
